package service.impl;

import bean.Favorite;
import dao.IFavoriteDao;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import service.IFavoriteService;

import javax.annotation.Resource;
import java.util.List;
@Service
@Transactional
public class FavoriteServiceImpl implements IFavoriteService {
    @Resource
    private IFavoriteDao iFavoriteDao;

    @Override
    public List<Favorite> queryAll() {
        return iFavoriteDao.queryAll();
    }

    @Override
    public Favorite queryById(Integer fid) {
        return iFavoriteDao.queryById(fid);
    }

    @Override
    public void add(Favorite favorite) {
        iFavoriteDao.add(favorite);
    }

    @Override
    public void update(Favorite favorite) {

        iFavoriteDao.update(favorite);
    }

    @Override
    public void delete(Favorite favorite) {
        iFavoriteDao.delete(favorite);
    }
}
